var __assign =
  (this && this.__assign) ||
  function () {
    __assign =
      Object.assign ||
      function (t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
          s = arguments[i];
          for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
        }
        return t;
      };
    return __assign.apply(this, arguments);
  };
import React, { useEffect, useMemo, useState } from 'react';
import { Form } from 'antd';
import { createLeggoItems } from '../../utils/createLeggoItems';
import { createMenuItem } from '../../utils/createMenuItem';
import { useConfigContext } from '../contexts/ConfigContext';
var layout = {
  labelCol: { span: 6 },
  wrapperCol: { span: 14 }
};
function LeggoLeft() {
  var itemStore = useConfigContext().itemStore;
  var _a = useState('antd'),
    storeKey = _a[0],
    setStoreKey = _a[1];
  var _b = useState(0),
    count = _b[0],
    setForceRender = _b[1];
  var _c = useState({}),
    fieldObj = _c[0],
    setFieldObj = _c[1];
  useEffect(function () {
    setFieldObj(createMenuItem([]));
  }, []);
  var leggoItems = useMemo(
    function () {
      return createLeggoItems(itemStore);
    },
    [itemStore]
  );
  return React.createElement(
    React.Fragment,
    null,
    React.createElement(
      'div',
      { className: 'leggo-configs-left' },
      React.createElement(
        'div',
        { className: 'top-area' },
        React.createElement('strong', null, '\u7EC4\u4EF6\u5E93')
      ),
      React.createElement(
        Form,
        __assign({}, layout),
        React.createElement('div', { className: 'leggo-configs-left-form-content' }, leggoItems)
      )
    )
  );
}
export default React.memo(LeggoLeft);
